package com.drugStorage.spring.ServiceImpl;

import java.util.List;

import com.drugStorage.domain.DrugSupplier;
import com.drugStorage.hibernate.dao.DrugSupplierDao;
import com.drugStorage.spring.service.DrugSupplierService;

public class DrugSupplierServiceImpl implements DrugSupplierService {

	private DrugSupplierDao drugSupplierDao;
	
	public DrugSupplierDao getDrugSupplierDao() {
		return drugSupplierDao;
	}

	public void setDrugSupplierDao(DrugSupplierDao drugSupplierDao) {
		this.drugSupplierDao = drugSupplierDao;
	}

	public void UnUsedDrugSupplier(DrugSupplier drugSupplier) {
		
		drugSupplier.setUseState("停用");
		drugSupplierDao.updateDrugSupplier(drugSupplier);
		
	}

	public void addDrugSupplier(DrugSupplier drugSupplier) {
		drugSupplierDao.saveDrugSupplier(drugSupplier);
		
	}

	public void delDrugSupplier(DrugSupplier drugSupplier) {
	    drugSupplierDao.delDrugSupplier(drugSupplier);
		
	}

	public DrugSupplier getDrugSupplier(int id) {
		
		return drugSupplierDao.getDrugSupplierById(id);
	}

	public List<DrugSupplier> getDrugSupplierList() {
		
		return drugSupplierDao.getDrugSuppliers();
	}

	public void updateDrugSupplier(DrugSupplier drugSupplier) {
		drugSupplierDao.updateDrugSupplier(drugSupplier);
		
	}



}
